var defaultContent="<button type=\"button\" class=\"btn btn_select_role \">选取</button>";
var storeId = $('#store').find("option:selected").val();

Date.prototype.format = function(format) {
   var date = {
          "M+": this.getMonth() + 1,
          "d+": this.getDate(),
          "h+": this.getHours(),
          "m+": this.getMinutes(),
          "s+": this.getSeconds(),
          "q+": Math.floor((this.getMonth() + 3) / 3),
          "S+": this.getMilliseconds()
   };
   if (/(y+)/i.test(format)) {
          format = format.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length));
   }
   for (var k in date) {
          if (new RegExp("(" + k + ")").test(format)) {
                 format = format.replace(RegExp.$1, RegExp.$1.length == 1
                        ? date[k] : ("00" + date[k]).substr(("" + date[k]).length));
          }
   }
   return format;
}
       
function showProduct() {
	var product_table = $('#product_table');

	product_table.dataTable({
	    "processing": true,
	    // 开启服务器模式
	    serverSide: true,
	    destroy:true, //Cannot reinitialise DataTable,解决重新加载表格内容问题  
	    "ajax": {
	    	url:layer_product,
	    	data:{"isActive":'1','storeId':storeId}// 列表查询
	    },
	    "autoWidth": false,
	    "columns": [
            {
		        "width": "10%",
		        "data": "imgUrl",
		        "render": function(data, type, row, meta) {
		            return "<img class='img-responsive center-block' src='"+data+"' alt='' />"
		      }
	    	},
            {"width": "20%","data": "title"},
            {
	            "width": "20%",
	            "data": "currentPrice",
	            "render": function(data, type, row, meta) {
	                return data/100;
	            }
	        },
            {
	            "width": "15%",
	            "data": "specClass",
	            "render": function(data, type, row, meta) {
	               if(data==1){
	            	   return "统一规格"
	               }else{
	            	   return "多规格"
	               }
	            }
	        },
	        {
	            "width": "15%",
	            "data": "created",
	            "render": function(data, type, row, meta) {
                    var newDate = new Date();
                    newDate.setTime(data * 1000);
                    return newDate.format('yyyy-MM-dd h:m:s');
	            }
	        },
            {"width": "30%","data": "null","defaultContent": defaultContent}
	    ],
	    "language": {
	    	url: '/public/static/assets/pages/Chinese.json'
	    },
	    "pageLength": 5,
	    "columnDefs": [{
	        "orderable": false,
	        "targets": [0,4,5]
	    }],
	    "dom": "<'row'<'.col-md-6 col-sm-12'><'col-md-6 col-sm-12'>r>" +
	        "<t>" +
	        "<'table_b relative'<'col-md-5'i><'col-md-7'>p>",
	    "fnInitComplete": function() {}
	});
	//选择商品
	product_table.on('click', '.btn_select_role', function(event) {
			 
		var oData_arr = product_table.DataTable().rows($(this).parents("tr")).data(); // 操作行对象
		var id=oData_arr[0].id;
			var selecttxt = oData_arr[0].title;
			console.log(selecttxt);
			$(".site #displayName").text(selecttxt);
			$(".site input[name='displayName']").val(selecttxt);
			$(".site input[name='linkId']").val(id);
			$(".popSite input[name='linkId']").val(id);//首页弹屏

			$(this).parents(".modal").modal('hide');
	});

}


function showProductType() {
	var productType_table = $('#productType_table');

    productType_table.dataTable({
        "processing": true,

        serverSide: true, // 开启服务器模式
        destroy:true, //Cannot reinitialise DataTable,解决重新加载表格内容问题  
        "ajax": {
          url: layer_productType, // 列表查询
        },
        "autoWidth": false,
        "columns": [
        {
            "width": "35%",
            "data": "name"
        },
        {
            "data": "createDate",
            "render": function(data, type, row, meta) {
                return moment(data).format('YYYY-MM-DD HH:mm');
            }
        },
        {
            "width": "30%",
            "data": "null",
            "defaultContent": defaultContent
        }
        ],
        "language": {
        	url: '/public/static/assets/pages/Chinese.json'
        },
        "pageLength": 10,
        "order": [
          [1, "desc"]
        ],
        "columnDefs": [{
          "orderable": false,
          "targets": [2]
        }],
        "dom": "<'row'<'.col-md-6 col-sm-12'><'col-md-6 col-sm-12'>r>" +
          "<t>" +
          "<'table_b relative'<'col-md-5'i><'col-md-7'>p>",
        "fnInitComplete": function() {}
    });
      //选择商品分类
	productType_table.on('click', '.btn_select_role', function(event) {
		 
	var oData_arr = productType_table.DataTable().rows($(this).parents("tr")).data(); // 操作行对象
	var id=oData_arr[0].id;
		// var selecttxt = $(this).parents("tr").find(".sorting_1").text();
		var selecttxt = oData_arr[0].name;

		console.log(id);
		$(".site input[name='linkId']").val(id);
		$(".site input[name='displayName']").val(selecttxt);
		$(".popSite input[name='linkId']").val(id);//首页弹屏

		$(this).parents(".modal").modal('hide');
	});

}

//拼团
function showSpellGroup() {
	var group_table = $('#group_table');

	group_table.dataTable({
	    "processing": true,	    
	    serverSide: true, // 开启服务器模式
	    destroy:true,  //Cannot reinitialise DataTable,解决重新加载表格内容问题  
	    "ajax" : {
			url : layer_groups,
			data:{'storeId':storeId} // 列表查询
		},
		"autoWidth" : false,
		"columns" : [
			{   "width" : "10%",
                "data": "imgUrl",
                "render": function(data, type, row, meta) {
                    return "<img class='center-block' src='"+data+"' alt='' />"
                }
            },
			{
				"width" : "20%",
				"data" : "title",
			},
			{
				"width" : "10%",
				"data" : "groupSuccCount",
			},
			{
    			"width" : "10%",
    			"data" : "groupPrice",
    			"render" : function(data, type, row, meta) {
    				if(data){
    					return row.groupPrice/100;

    				}else{
    					return "0";

    				}
    			}
			},
			{
				"width" : "10%",
				"data" : "currentPrice",
				"render" : function(data, type, row, meta) {
					if(data){
						return row.currentPrice/100;

					}else{
						return "0";

					}
				}
			},
			{
				"width" : "10%",
				 "data": "groupDateStr",
			},
			{
				"width" : "20%",
				  "data": "null",
                  "defaultContent": defaultContent     
			} ],
		"language" : {
			url: '/public/static/assets/pages/Chinese.json'
		},
		"destroy" : true,
		"ordering": false, 
		"pageLength" : 5,
		"order" : [ [ 0, "desc" ] ],
		"columnDefs" : [ {
			"orderable" : false,
			"targets" : [ 0,1,2,3,4]
		} ],
		"dom" : "<'row'<'.col-md-6 col-sm-12'><'col-md-6 col-sm-12'>r>"
				+ "<t>" + "<'row'<'col-md-5'i><'col-md-7'>p>",
		"fnInitComplete" : function() {
		}
	});
	//选择拼团
	group_table.on('click', '.btn_select_role', function(event) {
			 
		var oData_arr = group_table.DataTable().rows($(this).parents("tr")).data(); // 操作行对象
		var id=oData_arr[0].id;
			var selecttxt = oData_arr[0].title;
			console.log(selecttxt);
			$(".site #displayName").text(selecttxt);
			$(".site input[name='displayName']").val(selecttxt);
			$(".site input[name='linkId']").val(id);
			$(".popSite input[name='linkId']").val(id);//首页弹屏

			$(this).parents(".modal").modal('hide');
		});

}
    		
//文章
function showArticle() {
	var article_table = $('#article_table');

	article_table.dataTable({
	    "processing": true,
	    // 开启服务器模式
	    serverSide: true,
	    destroy:true,
	    "ajax": {
            url: layer_articles, // 列表查询
            data:{"status":'上线'}// 列表查询
        },
        "autoWidth": true,
        "columns": [{
        	 "width" : "10%",
			"data": "smallUrl",
			"render": function(data, type, row, meta) {
				return "<img class='center-block' src='" + data + "' alt='' />"
			}
		},{
            "width":"35%",
            "data": "title",
            "render": function(data, type, row, meta) {
					return "<h4>" + data + "</h4>"
				}
        },
        {
            "data": "orderNo",
         
        },
        {
           "width":"20%",
            "data": "createDate",
            "render": function(data, type, row, meta) {
                return moment(data).format('YYYY-MM-DD HH:mm');
            }
        },
     
        {
            
        	  "data": "null",
              "defaultContent": defaultContent     
        }
        ],
        "language": {
        	url: '/public/static/assets/pages/Chinese.json'
        },
        "pageLength": 10,
        "order": [
            [3, "asc"]
        ],
        "columnDefs": [{
            "orderable": false,
            "targets": [2,4]
        }],
        "dom" : "<'row'<'.col-md-6 col-sm-12'><'col-md-6 col-sm-12'>r>"
		+ "<t>" + "<'table_b relative'<'col-md-5'i><'col-md-7'>p>",
        "fnInitComplete": function() {},
			
    });
	//选择文章
	article_table.on('click', '.btn_select_role', function(event) {
			 
		var oData_arr = article_table.DataTable().rows($(this).parents("tr")).data(); // 操作行对象
		var id=oData_arr[0].id;
			var selecttxt = oData_arr[0].title;
			console.log(selecttxt);
			$(".site #displayName").text(selecttxt);
			$(".site input[name='displayName']").val(selecttxt);

			$(".site input[name='linkId']").val(id);
			$(".popSite input[name='linkId']").val(id);//首页弹屏

			$(this).parents(".modal").modal('hide');
		});

}

//文章分类
function showArticleType() {
	var articleType_table = $('#articleType_table');
    alert('待删除');return;

	articleType_table.dataTable({
	    "processing": true,
	    // 开启服务器模式
	    serverSide: true,
	    destroy:true,
	    "ajax" : {
			url : "/a/wxconf/articleTypes", // 列表查询
		// data: json
		},
		"autoWidth" : false,
		"columns" : [
				{
					"width" : "25%",
					"data" : "name"
				},
				{
					"width" : "10%",
					"data" : "orderNo"
				},
				{
					"width" : "35%",
					"data" : "createDate"
				},
				{
					"width" : "30%",
					  "data": "null",
	                  "defaultContent": defaultContent     
				} ],
		"language" : {
			url:'/assets/pages/Chinese.json'
		},
		"pageLength" : 5,
		"order" : [ [ 1, "asc" ] ],
		"columnDefs" : [ {
			"orderable" : false,
			"targets" : [ 0,3 ]
		}, {
			"targets" : 2,
			"render" : function(data, type, row, meta) {
				return moment(data).format('YYYY-MM-DD HH:mm');
			}
		} ],
		"dom" : "<'row'<'.col-md-6 col-sm-12'><'col-md-6 col-sm-12'>r>"
				+ "<t>" + "<'table_b relative'<'col-md-5'i><'col-md-7'>p>",
		"fnInitComplete" : function() {
		},
		"fnDrawCallback": function() {
		}
	});

	//文章分类
	articleType_table.on('click', '.btn_select_role', function(event) {
			 
		var oData_arr = articleType_table.DataTable().rows($(this).parents("tr")).data(); // 操作行对象
		var id=oData_arr[0].id;
			var selecttxt = oData_arr[0].name;
			console.log(selecttxt);
			$(".site #displayName").text(selecttxt);
			$(".site input[name='displayName']").val(selecttxt);

			$(".site input[name='linkId']").val(id);
			$(".popSite input[name='linkId']").val(id);//首页弹屏

			$(this).parents(".modal").modal('hide');
		});

}

//积分列表
function showIntegral() {
	var integral_table = $('#integral_table');

	integral_table.dataTable({
	    "processing": true,
	    // 开启服务器模式
	    serverSide: true,
	    destroy:true,
	    "ajax" : {
			url : layer_points,
			data:{'storeId':storeId}// 列表查询
		},
		"autoWidth" : false,
		"columns" : [
			{   "width" : "10%",
                "data": "imgUrl",
                "render": function(data, type, row, meta) {
                    return "<img class='center-block' src='"+data+"' alt='' />"
              }
            },
				{
					"width" : "20%",
					"data" : "title",
				},
				{
					"width" : "10%",
					"data" : "currentPrice",
					"render" : function(data, type, row, meta) {
						return row.currentPrice/100;
						}
				},
				{
					"width" : "10%",
					"data" : "integralPrice",
				},
				{
					"width" : "20%",
					  "data": "null",
	                  "defaultContent": defaultContent     
				} ],
		"language" : {
			url:'/public/static/assets/pages/Chinese.json'
		},
		"destroy" : true,
		"ordering": false, 
		"pageLength" : 5,
		"order" : [ [ 0, "desc" ] ],
		"columnDefs" : [ {
			"orderable" : false,
			"targets" : [ 0,1,2,3,4]
		} ],
		"dom" : "<'row'<'.col-md-6 col-sm-12'><'col-md-6 col-sm-12'>r>"
				+ "<t>" + "<'row'<'col-md-5'i><'col-md-7'>p>",
		"fnInitComplete" : function() {
		}
	});

	//选择积分
	integral_table.on('click', '.btn_select_role', function(event) {
			 
		var oData_arr = integral_table.DataTable().rows($(this).parents("tr")).data(); // 操作行对象
		var id=oData_arr[0].id;
			var selecttxt = oData_arr[0].title;
			console.log(selecttxt);
			$(".site #displayName").text(selecttxt);
			$(".site input[name='displayName']").val(selecttxt);

			$(".site input[name='linkId']").val(id);
			$(".popSite input[name='linkId']").val(id);//首页弹屏

			$(this).parents(".modal").modal('hide');
		});

}

//门店列表
function showTenant() {
	var tenant_table = $('#tenant_table');

	tenant_table.dataTable({
	    "processing": true,	    
	    serverSide: true, // 开启服务器模式
	    destroy:true,
	    "ajax": {
        	url:layer_storeList,
        },
        "autoWidth": false,
        "columns": [
            {
                "width": "15%",
                "data": "name"
            },
            {
                "width": "20%",
                "data": "address",
                "render" : function(data, type, row, meta) {
                	if(row.province.indexOf("市")<0){
                		return row.province+row.city+row.district+row.address;
                	}else{
                		return row.province+row.district+row.address;
                	}
					
				}
            },
            {
                "width": "11%",
                "data": "phone" 
            },
            {
                "width": "15%",
                "data": "openWeek",
                "render": function(data, type, row, meta) {
                	return row.openWeek+"</br>"+row.openTime+"至"+row.closeTime;
                }
            },
            {
                "width": "11%",
                "data": "qrCode",
               "visible":false
            },
            {
                "width": "11%",
                "data": "stoCode",
               "visible":false
            },
            {
                "width": "11%",
                "data": "createDate",
               "visible":false
            },
            {
                "width": "15%",
                "data": "null",
                  "defaultContent": defaultContent     
                  }
        ],
        "language": {
        	url:'/public/static/assets/pages/Chinese.json'
        },
        "pageLength": 5,
        "ordering": false, // 禁止排序
        
        "columnDefs": [{
            "orderable": false,
            "targets": [0,1,2,3,4,5,6,7]
        }],
        "dom": "<'row'<'.col-md-6 col-sm-12'><'col-md-6 col-sm-12'>r>" +
        "<t>" +
        "<'row'<'col-md-5'i><'col-md-7'>p>",
        "fnInitComplete": function() {},
        /*"fnDrawCallback": function(){
          	　　var api = this.api();
          	　　var startIndex= api.context[0]._iDisplayStart;//获取到本页开始的条数
          	　　api.column(0).nodes().each(function(cell, i) {
          	　　　　cell.innerHTML = startIndex + i + 1;
          	　　}); 
          	}*/
    });

	//选择门店
	tenant_table.on('click', '.btn_select_role', function(event) {
			 
		var oData_arr = tenant_table.DataTable().rows($(this).parents("tr")).data(); // 操作行对象
		var id=oData_arr[0].id;
			var selecttxt = oData_arr[0].name;
			console.log(selecttxt);
			$(".site #displayName").text(selecttxt);
			$(".site input[name='linkId']").val(id);
			$(".site input[name='displayName']").val(selecttxt);
			$(".popSite input[name='linkId']").val(id);//首页弹屏

			$(this).parents(".modal").modal('hide');
	});
}

//轮播图设置链接类型
var clickControl=0;
$("#applet .advertisement_talbe").each(function(i){
    var listid = $(this).parent().attr('id');
    index = listid.substr(listid.length-1,1);
    $("#advertisement_talbe"+index).on("click","[name='linkType']",function(){
        var selecttxt = $(this).find("option:selected").val();
        $(".modal").modal("hide");
        if(clickControl%2 ==1){
            getPage(selecttxt);
     }  
        clickControl++;
    });

    $("#advertisement_talbe"+index).on("blur","[name='linkType']",function(){             
        clickControl=0;
    });

});

//按钮导航设置链接类型
$("#applet .iconArea_talbe").each(function(i){
    var listid = $(this).parent().attr('id');
    index = listid.substr(listid.length-1,1);
    $("#iconArea_talbe"+index).on("blur","[name='linkType']",function(){
        clickControl=0;
    });

    $("#iconArea_talbe"+index).on("click","[name='linkType']",function(){
        var selecttxt = $(this).find("option:selected").val();
        if(clickControl%2 ==1){
            getPage(selecttxt);
        }
        clickControl++;
    });
});

//推荐内容设置链接类型
$("#applet .commodity_table").each(function(i){
    var listid = $(this).parent().attr('id');
    index = listid.substr(listid.length-1,1);
    $("#commodity_table"+index).on("blur","[name='linkType']",function(){
        clickControl=0;
    });

    $("#commodity_table"+index).on("click","[name='linkType']",function(){
        var selecttxt = $(this).find("option:selected").val();
        if(clickControl%2 ==1){
            getPage(selecttxt);
        }
        clickControl++;
    });
});


            //推荐商品选择
            $("#commodity_table").on("click","[name='linkType']",function(){
                // var selecttxt = $("#commodity_table [name='linkType'] option:selected").val();
            	var selecttxt = 1;
            	showProduct();
            	$(".ban-link").modal("show");
            });

    		//拼团商品选择
    		$("#groupbuy_table").on("click","[name='linkType']",function(){
    			var selecttxt = $("#groupbuy_table [name='linkType'] option:selected").val();
    			showSpellGroup();
    			$(".group-link").modal("show");
    		});
    		
    		//文章选择
    		$("#article_ban_table").on("click","[name='linkType']",function(){
    			var selecttxt = $("#article_ban_table [name='linkType'] option:selected").val();
    			showArticle();
    			$(".article-link").modal("show");
    		});

$("#applet .pic_ban_table").each(function(i){
    var listid = $(this).parent().attr('id');
    index = listid.substr(listid.length-1,1);
    $("#pic_ban_table"+index).on("click","[name='linkType']",function(){
    	var selecttxt = $(this).find("option:selected").val();
    	console.log(selecttxt);
    	if(clickControl%2 ==1){
    		getPage(selecttxt);
    	}
    	clickControl++;
    });
});

//轮播图
var advertisementTemplate = stringLines(function(){/*
	<tr >
		<td>
           <div id="btn-uploader"><a id="pickfiles" href="javascript:void 0;" onclick="getAllPic(this)">
           <img    name="img_qiniu_url"   /></a>
           </div>
           <small>请上传750*400分辨率的图片</small>
	    </td>
	    <td>
		    <select name="linkType">
                <option value="0" selected>无连接</option>
                <option value="1">商品详情</option><option value="2">商品分类</option>
                <option value="9">拼团列表</option><option value="6">拼团商品</option>
                <option value="7" >文章</option><option value="28">文章列表</option>
                <option value="10">积分商品列表</option><option value="11">积分商品详情</option>
                <option value="13">门店列表</option>
                <option value="29">首页</option><option value="21" >分享返现</option>
                <option value="22" >会员开通</option><option value="24" >我的订单</option>
                <option value="25" >我的优惠券</option><option value="26" >我的拼团</option>
                <option value="27" >账户余额</option><option value="30" >联系商家</option>
                <option value="31" >扫码买单</option><option value="32">位置导航 </option>
            </select>
	    </td>
	    <td>
	         <input type="number" min="1" name="orderNo"  class="form-control " />
	         <input type="hidden" name="linkId"/><input type="hidden" name="displayName"/>
	    </td>
	    <td>
	         <button type="button" name="saveAdvertisement" class="btn btn_save_role">保存</button>
	         <button type="button" class="btn btn_cancle_role">取消</button>
	    </td>
	</tr>
*/});

//图标按钮
var iconTemplate = stringLines(function(){/*
	<tr >
		<td>
		   <div id="btn-uploader" onclick="getAllPic(this)"><a id="pickfiles" href="javascript:void 0;"><img   name="img_qiniu_url"   /></a></div>
		   <small>请上传51*51分辨率的图片</small></td><td><input type="text" name="displayName" class="form-control " />
	   </td>
	   <td>
		  <select name="linkType" >
		   	    <option value="0" selected>无连接</option>
                <option value="1">商品详情</option><option value="2">商品分类</option>
                <option value="9">拼团列表</option><option value="6">拼团商品</option>
                <option value="7" >文章</option><option value="28">文章列表</option>
                <option value="10">积分商品列表</option><option value="11">积分商品详情</option>
                <option value="13">门店列表</option>
                <option value="29">首页</option><option value="21" >分享返现</option>
                <option value="22" >会员开通</option><option value="24" >我的订单</option>
                <option value="25" >我的优惠券</option><option value="26" >我的拼团</option>
                <option value="27" >账户余额</option><option value="30" >联系商家</option>
                <option value="31" >扫码买单</option><option value="32">位置导航 </option>
		  </select>
	   </td>
	  <td>
	    <input type="number" min="1" name="orderNo" class="form-control " />
	    <input type="hidden" name="linkId"/>
	  </td>
	   <td>
	    <button type="button" name="saveAdvertisement" class="btn btn_save_role">保存</button>
	    <button type="button" class="btn btn_cancle_role">取消</button>
	  </td>
	</tr>
*/});

                    //推荐内容模板
                    var productTemplate = stringLines(function(){/*
                    	<tr >
                    		<td>
                    		<select name="linkType">
                                <option value="" disabled selected>设置链接到的页面</option>
                                <option value="1">商品</option><option value="7">文章</option>
                                <option value="6">拼团</option><option value="11">积分兑换</option>
                              </select>
                    	   </td>
                    	   <td>
                    		   <input type="number" min="1" name="orderNo" class="form-control" />
                    		   <input type="hidden" name="linkId"/>
                               <input type="hidden" name="displayName"/>
                    	   </td>
                    	  <td>
                    	      <button type="button" name="saveAdvertisement" class="btn btn_save_role">保存</button>
                    	      <button type="button" class="btn btn_cancle_role">取消</button>
                    	  </td>
                    	</tr>
                    */});
    		    	
    		    	
    		    	//文章模板
    		    	var articleTemplate = stringLines(function(){/*
    		    		<tr >
    		    			<td>
    		    				<button type="button" name="linkType" class="btn ">选择文章</button>
    		    				<label class="control-label" name="displayName" id="displayName"></label>
    		    				<input type="hidden" name="imgUrl"/>
    		    		   </td>
    		    		   <td>
    		    			   <input type="number" min="1" name="orderNo" class="form-control" />
    		    			   <input type="hidden" name="linkId"/>
    		    		   </td>
    		    		  <td>
    		    		      <button type="button" name="saveAdvertisement" class="btn btn_save_role">保存</button>
    		    		      <button type="button" class="btn btn_cancle_role">取消</button>
    		    		  </td>
    		    		</tr>
    		    	*/});
    		    	
    		   
    		    	//拼团模板
    		    	var groupTemplate = stringLines(function(){/*
    		    		<tr >
    		    			<td>
    		    				<button type="button" name="linkType" class="btn ">选择拼团商品</button>
    		    				<label class="control-label" name="displayName" id="displayName"></label>
    		    				<input type="hidden" name="imgUrl"/>
    		    		   </td>
    		    		   <td>
    		    			 <input type="number" min="1" name="orderNo" class="form-control" />
    		    			 <input type="hidden" name="linkId"/>
    		    		   </td>
    		    		  <td>
    		    		    <button type="button" name="saveAdvertisement" class="btn btn_save_role">保存</button>
    		    		    <button type="button" class="btn btn_cancle_role">取消</button>

    		    		  </td>
    		    		</tr>
    		    	*/});
    		    	
//自适应图片
var picTemplate = stringLines(function(){/*
	<tr >
		<td>
	        <div id="btn-uploader"><a id="pickfiles10"  onclick="getAllPic(this)" href="javascript:void 0;"><img    name="img_qiniu_url"   /></a></div><small>请上传大小≤500kb，格式png、jpg、gif</small>
	   </td>
	   <td>
		  <select name="linkType" >
		        <option value="0" selected>无连接</option>
                <option value="1">商品详情</option><option value="2">商品分类</option>
                <option value="9">拼团列表</option><option value="6">拼团商品</option>
                <option value="7" >文章</option><option value="28">文章列表</option>
                <option value="10">积分商品列表</option><option value="11">积分商品详情</option>
                <option value="13">门店列表</option>
                <option value="29">首页</option><option value="21" >分享返现</option>
                <option value="22" >会员开通</option><option value="24" >我的订单</option>
                <option value="25" >我的优惠券</option><option value="26" >我的拼团</option>
                <option value="27" >账户余额</option><option value="30" >联系商家</option>
                <option value="31" >扫码买单</option><option value="32">位置导航 </option>
            </select>
	   </td>
	  <td>
	      <input type="number" min="1" name="orderNo"  class="form-control " />
	      <input type="hidden" name="linkId"/><input type="hidden" name="displayName" id="displayName"/>

	  </td>
	   <td>
	     <button type="button"  class="btn btn_save_role">保存</button>
	     <button type="button" class="btn btn_cancle_role">取消</button>

	  </td>
	</tr>
*/});
    		    
//根据弹框选择不同的弹出层	
function getPage(selecttxt){
	if (selecttxt == "1") {
		$(".modal").modal("hide");
		showProduct();
		$(".ban-link").modal("show");
	}else if(selecttxt == "2"){
		showProductType();
		$(".modal").modal("hide");
		$(".ban-linktype").modal("show");
	}else if(selecttxt == "7"){
		showArticle();
		$(".modal").modal("hide");
		$(".article-link").modal("show");
	}else if(selecttxt == "8"){
		showArticleType();
		$(".modal").modal("hide");
		$(".articleType-link").modal("show");
	}else if(selecttxt == "6"){
		showSpellGroup();
		$(".modal").modal("hide");
		$(".group-link").modal("show");
	}else if(selecttxt == "11"){
		$(".modal").modal("hide");
		showIntegral();
		$(".integral-link").modal("show");
	}else if(selecttxt == "14"){
		$(".modal").modal("hide");
		showTenant();
		$(".tenant-link").modal("show");
	}
}


function isRequireLinkId(linkType){
	var ok=false;
   	if (linkType =='1'||linkType == '2'||linkType=='6'||linkType == '7'||linkType=='11' ) {
   		ok=true;
	}
   	return ok;
}	
    		    
    		
